package com.eightbears.greendao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.eightbears.greendao.District;
import com.eightbears.greendao.SearchKey;
import com.eightbears.greendao.Friends;
import com.eightbears.greendao.MyAddress;
import com.eightbears.greendao.TopEaseUser;
import com.eightbears.greendao.MessageStatus;
import com.eightbears.greendao.GroupList;
import com.eightbears.greendao.GroupMember;
import com.eightbears.greendao.Member;

import com.eightbears.greendao.DistrictDao;
import com.eightbears.greendao.SearchKeyDao;
import com.eightbears.greendao.FriendsDao;
import com.eightbears.greendao.MyAddressDao;
import com.eightbears.greendao.TopEaseUserDao;
import com.eightbears.greendao.MessageStatusDao;
import com.eightbears.greendao.GroupListDao;
import com.eightbears.greendao.GroupMemberDao;
import com.eightbears.greendao.MemberDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig districtDaoConfig;
    private final DaoConfig searchKeyDaoConfig;
    private final DaoConfig friendsDaoConfig;
    private final DaoConfig myAddressDaoConfig;
    private final DaoConfig topEaseUserDaoConfig;
    private final DaoConfig messageStatusDaoConfig;
    private final DaoConfig groupListDaoConfig;
    private final DaoConfig groupMemberDaoConfig;
    private final DaoConfig memberDaoConfig;

    private final DistrictDao districtDao;
    private final SearchKeyDao searchKeyDao;
    private final FriendsDao friendsDao;
    private final MyAddressDao myAddressDao;
    private final TopEaseUserDao topEaseUserDao;
    private final MessageStatusDao messageStatusDao;
    private final GroupListDao groupListDao;
    private final GroupMemberDao groupMemberDao;
    private final MemberDao memberDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        districtDaoConfig = daoConfigMap.get(DistrictDao.class).clone();
        districtDaoConfig.initIdentityScope(type);

        searchKeyDaoConfig = daoConfigMap.get(SearchKeyDao.class).clone();
        searchKeyDaoConfig.initIdentityScope(type);

        friendsDaoConfig = daoConfigMap.get(FriendsDao.class).clone();
        friendsDaoConfig.initIdentityScope(type);

        myAddressDaoConfig = daoConfigMap.get(MyAddressDao.class).clone();
        myAddressDaoConfig.initIdentityScope(type);

        topEaseUserDaoConfig = daoConfigMap.get(TopEaseUserDao.class).clone();
        topEaseUserDaoConfig.initIdentityScope(type);

        messageStatusDaoConfig = daoConfigMap.get(MessageStatusDao.class).clone();
        messageStatusDaoConfig.initIdentityScope(type);

        groupListDaoConfig = daoConfigMap.get(GroupListDao.class).clone();
        groupListDaoConfig.initIdentityScope(type);

        groupMemberDaoConfig = daoConfigMap.get(GroupMemberDao.class).clone();
        groupMemberDaoConfig.initIdentityScope(type);

        memberDaoConfig = daoConfigMap.get(MemberDao.class).clone();
        memberDaoConfig.initIdentityScope(type);

        districtDao = new DistrictDao(districtDaoConfig, this);
        searchKeyDao = new SearchKeyDao(searchKeyDaoConfig, this);
        friendsDao = new FriendsDao(friendsDaoConfig, this);
        myAddressDao = new MyAddressDao(myAddressDaoConfig, this);
        topEaseUserDao = new TopEaseUserDao(topEaseUserDaoConfig, this);
        messageStatusDao = new MessageStatusDao(messageStatusDaoConfig, this);
        groupListDao = new GroupListDao(groupListDaoConfig, this);
        groupMemberDao = new GroupMemberDao(groupMemberDaoConfig, this);
        memberDao = new MemberDao(memberDaoConfig, this);

        registerDao(District.class, districtDao);
        registerDao(SearchKey.class, searchKeyDao);
        registerDao(Friends.class, friendsDao);
        registerDao(MyAddress.class, myAddressDao);
        registerDao(TopEaseUser.class, topEaseUserDao);
        registerDao(MessageStatus.class, messageStatusDao);
        registerDao(GroupList.class, groupListDao);
        registerDao(GroupMember.class, groupMemberDao);
        registerDao(Member.class, memberDao);
    }
    
    public void clear() {
        districtDaoConfig.getIdentityScope().clear();
        searchKeyDaoConfig.getIdentityScope().clear();
        friendsDaoConfig.getIdentityScope().clear();
        myAddressDaoConfig.getIdentityScope().clear();
        topEaseUserDaoConfig.getIdentityScope().clear();
        messageStatusDaoConfig.getIdentityScope().clear();
        groupListDaoConfig.getIdentityScope().clear();
        groupMemberDaoConfig.getIdentityScope().clear();
        memberDaoConfig.getIdentityScope().clear();
    }

    public DistrictDao getDistrictDao() {
        return districtDao;
    }

    public SearchKeyDao getSearchKeyDao() {
        return searchKeyDao;
    }

    public FriendsDao getFriendsDao() {
        return friendsDao;
    }

    public MyAddressDao getMyAddressDao() {
        return myAddressDao;
    }

    public TopEaseUserDao getTopEaseUserDao() {
        return topEaseUserDao;
    }

    public MessageStatusDao getMessageStatusDao() {
        return messageStatusDao;
    }

    public GroupListDao getGroupListDao() {
        return groupListDao;
    }

    public GroupMemberDao getGroupMemberDao() {
        return groupMemberDao;
    }

    public MemberDao getMemberDao() {
        return memberDao;
    }

}
